package model;


import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;


@Entity
public class File implements Serializable{

	
	/**
	 * @param share
	 * @param typeFile
	 * @param pathFile
	 */
	public File(Share share, String typeFile,
			String contentFile) {
		super();
		this.share = share;
		this.typeFile = typeFile;
		this.pathFile = contentFile;
	}
	
	public File() {
		super();
		// TODO Auto-generated constructor stub
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	//id du fichier;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	int idFile;
	
	@OneToOne(mappedBy="file", cascade = {CascadeType.PERSIST, CascadeType.REMOVE})
    private Share share;
		
	//type du fichier
	String typeFile;
	
	//contenu du fichier
	String pathFile;

	public int getIdFile() {
		return idFile;
	}

	public void setIdFile(int idFile) {
		this.idFile = idFile;
	}

	public Share getShare() {
		return share;
	}

	public void setShare(Share share) {
		this.share = share;
	}

	public String getTypeFile() {
		return typeFile;
	}

	public void setTypeFile(String typeFile) {
		this.typeFile = typeFile;
	}
	
	public String getPathFile() {
		return pathFile;
	}

	public void setPathFile(String pathFile) {
		this.pathFile = pathFile;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Override
	public int hashCode() {
		int result = 1;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		return true;
	}
	
}
